/*
 ***************************************************************************
 * MediaTeK Inc.
 * 4F, No. 2 Technology	5th	Rd.
 * Science-based Industrial	Park
 * Hsin-chu, Taiwan, R.O.C.
 *
 * (c) Copyright 2002-2012, MTK.
 *
 * All rights reserved.	MediaTeK's source	code is	an unpublished work	and	the
 * use of a	copyright notice does not imply	otherwise. This	source code
 * contains	confidential trade secret material of MediaTeK Tech. Any attemp
 * or participation	in deciphering,	decoding, reverse engineering or in	any
 * way altering	the	source code	is stricitly prohibited, unless	the	prior
 * written consent of MediaTeK, Inc. is obtained.
 ***************************************************************************

	Module Name:
	omci_me.h

	Abstract:

	Revision History:
	Who			When			What
	--------	----------		----------------------------------------------
	Name		Date			Modification logs
	jq.zhu		2012/6/28	Create
*/


#ifndef _OMCI_ME_H_
#define _OMCI_ME_H_


#include <pthread.h>
#include <unistd.h>
#include <arpa/inet.h>
#include "omci_types.h"
#include "omci_external_msg.h"
#include "omci_lib_internal.h"
#include "omci_me_external.h"
#include "omci_internal_export.h"


/************************************************************************
*                        			MACRO							
************************************************************************
*/
#ifndef GNU_PACKED
#define GNU_PACKED __attribute__ ((packed))
#endif//GNU_PACKED


#if __BYTE_ORDER == __LITTLE_ENDIAN
	#undef __BIG_ENDIAN
#else
	#undef __LITTLE_ENDIAN
#endif


#define	SOFTWARE_IMAGE_STATE_S0			0
#define	SOFTWARE_IMAGE_STATE_S1_0		1
#define	SOFTWARE_IMAGE_STATE_S2_0		2
#define	SOFTWARE_IMAGE_STATE_S3_0		3
#define	SOFTWARE_IMAGE_STATE_S4_0		4
#define	SOFTWARE_IMAGE_STATE_S4_1		5
#define	SOFTWARE_IMAGE_STATE_S3_1		6
#define	SOFTWARE_IMAGE_STATE_S2_1		7
#define	SOFTWARE_IMAGE_STATE_S1_1		8

#define ONLY_OMCI 			    0
#define ONLY_NOOMCI		        1
#define OMCI_AND_NOOMCI 	    2
#define OMCI_ALM 	            0
#define OMCI_NALM	            1

#define OMCI_SAVE_FILE_MAX_SIZE     (400*1024)  /*400kB*/
#define OMCI_SAVE_TOTAL_FILE_NUM    5 
#define OMCI_SAVE_PKT_LEN           48 

#define OMCI_SAVE_EVENT_MAX_SIZE       (100*1024)  /*100kB*/
#define OMCI_SAVE_EVENT_FILE_TOTAL_NUM 2


#define OMCI_SAVE_PKT_ALL                                  0
#define OMCI_SAVE_PKT_ALL_EXCEPT_UPGRADE                   1
#define OMCI_SAVE_PKT_FILTEROUT_MIBUPLOAD_PMDATA_UPGRADE   2
#define OMCI_SAVE_PKT_FILTEROUT_MIBUPLOAD_UPGRADE          3
#define OMCI_SAVE_PKT_FILTEROUT_PMDATA_UPGRADE             4


#define OMCI_INDEX_PATH   "/tmp/currIndex.txt"

/*mode  1:saveall,2:filter out mipupload and getPM data,3:filter out mipupload, 4:filter out getPM data*/




#define	NORMAL				    (0)
#define	UNNEED_MIB_UPLOAD 		(1<<0)			/*when the bit is setted, the me is not needed to upload in MIB UPLOAD action*/
#define IS_CLASSICAL_PM_ME		(1<<1)			/*when the bit is setted, the me is classical performance monitor manage entity*/
#define	IS_EXTENDED_PM_ME		(1<<2)			/*when the bit is setted, the me is extended performance monitor manage entity*/
#define NO_AVC				    0
#define YES_AVC                 1
#define YES_TCA                 1

#define UNIT_TYPE_MIXED_SERVICES_EQUIPMENT 	    45
#define UNIT_TYPE_BASET_10100					24
#define UNIT_TYPE_BASET_101001000				47
#define UNIT_TYPE_VEIP							48
#define UNIT_TYPE_GPON24881244				    248
#define UNIT_TYPE_POTS							32
#define UNIT_TYPE_XGPON10G2488				    237
#define UNIT_TYPE_XGSPON10G10G    				238
#define UNIT_TYPE_ETHER_10G						49

#ifdef TCSUPPORT_VNPTT
    #define VNPTT_NOT_SUPPORT_UPLOAD       1
#else
    #define VNPTT_NOT_SUPPORT_UPLOAD       0
#endif

#ifdef TCSUPPORT_CHS
    #define CHS_NOT_SUPPORT_UPLOAD       1
#else
    #define CHS_NOT_SUPPORT_UPLOAD       0
#endif

#define ATTRIBUTE_NAME_LENGTH			128


#define GPON_NUM_INST_INIT               ((pSystemCap->gponNum != 0)?1:0)
#define FE_NUM_INST_INIT                 ((pSystemCap->feNum != 0)?1:0)
#define GE_NUM_INST_INIT                 ((pSystemCap->geNum != 0)?1:0)
#define ETHER_10G_NUM_INST_INIT          ((pSystemCap->eth10GNum != 0)?1:0)
#define ETHER_2500_NUM_INST_INIT         ((pSystemCap->eth2500Num != 0)?1:0)
#define POTS_NUM_INST_INIT               ((pSystemCap->potsNum != 0)?1:0)
#define VEIP_NUM_INST_INIT               ((pSystemCap->veipNum != 0)?1:0)
#define WLAN_NUM_INST_INIT               ((pSystemCap->wlanNum != 0)?1:0)
#define VIDEO_UNI_NUM_INST_INIT               ((pSystemCap->videoUniNum!= 0)?1:0)
#define VIDEO_ANI_NUM_INST_INIT               ((pSystemCap->videoAniNum!= 0)?1:0)
#define XGPON_MODE_INST_INIT            ((pOnuCap->linkMode == OMCI_MODE_XGPON)||(pOnuCap->linkMode == OMCI_MODE_XGSPON) || (pOnuCap->linkMode == OMCI_MODE_NG2_10G_10G))

#define         MAX_OMCI_NUM    512
#define			MAX_OMCI_UPGRADE_SECTION_NUM	256

extern uint16_t stdOmciIndexMap[MAX_OMCI_NUM];
extern uint8_t omciDbgFlag;
extern uint8_t clearPreAlarmInfoEnable;
extern pthread_mutex_t omciSave2FileLock;
extern uint8_t saveOmciPktMode;
extern uint8_t saveOmciPktEnable;



/************************************************************************
*                        			struct							
************************************************************************
*/

typedef struct omciAttriDescript_s
{
    uint8_t   attriIndex;
    char   attriName[ATTRIBUTE_NAME_LENGTH];
    uint16_t  attriLen;//0:un-inited;    0: variable length
    uint8_t   attriAccess;//R, W, R/W.....
    uint8_t   format;//POINTTER;BIT_FIELD...
    uint64_t  lowerLimit;
    uint64_t  uppererLimit;
    uint32_t  bitField;
    uint16_t *codePointTbl;// point to the code point table buffer
    //uint8_t   support;
    uint32_t  avcId;
    struct _Attributefunc *func;
}omciAttriDescript_t,*omciAttriDescript_ptr;

typedef int(*GetValueInfoFun)(uint8_t *value, uint8_t *meInstantPtr, omciAttriDescript_t * omciAttribute, uint8_t flag);/*if the ME is PM node, flag=0, get history data; flag=1, get current data*/
typedef int(*SetValueInfoFun)(uint8_t *value, uint8_t *meInstantPtr, omciAttriDescript_t * omciAttribute, uint8_t flag);/*flag, 0:create action, 1:set action*/

typedef struct _Attributefunc
{
	GetValueInfoFun getValueInfo;
	SetValueInfoFun setValueInfo;
}AttributeFunc;


typedef struct omciAlarm_s
{
	uint8_t alarmBitmap[MT_OMCI_ALARM_BITMAP_LENGTH];
	omci_evt_id_t event_id;
	uint8_t recordReportAlarm[OMCI_ALARM_RECORD_FLAG_LENGTH];
}omciAlarm_t,*omciAlarm_ptr;

typedef struct omciTableAttriValue_s{
	struct omciTableAttriValue_s *next;
	uint8_t attriIndex;
	uint32_t tableSize;
	uint8_t *tableValue_p;
}omciTableAttriValue_t, *omciTableAttriValue_p;

typedef struct downloadSection_s
{
	struct downloadSection_s *nextSection;
	uint8_t *secContent;
	uint16_t secLength;	
	uint8_t secNum;	/*section number*/
}downloadSection_t,*downloadSection_ptr;

typedef struct downloadWindow_s
{
	struct downloadWindow_s *nextWindow;
	uint32_t windowNum;	/*window number*/
	downloadSection_t *sectionList_p;
}downloadWindow_t,*downloadWindow_ptr;

typedef struct downloadImage_s
{
	uint32_t totalSize;
	uint32_t currentSize;
	//downloadWindow_t *currentWindowPtr;
	//downloadWindow_t *preWindowPtr;
	//downloadWindow_t *windowList;
}downloadImage_t,*downloadImage_ptr;


typedef struct omciMeInst_s
{
	struct omciMeInst_s *next;
	uint16_t classId;
	uint8_t *attributeVlaue_ptr;//pointer to the memory of instance data
	omciAlarm_t *meAlarm;//alarm bit map	
	uint16_t deviceId;//device id for AVC,alarm,TCA,test report
	//for ARC use
	uint8_t interval;//0~255 minites; 0: no arc; 255: not timeout
	uint8_t arcState;//ALM:0 ;NALM: 1
	int arcTm;//record ARC timer
	//to store table value
	omciTableAttriValue_t *tableValueList;
	uint8_t *otherInfo; //for some me maintain information
}omciMeInst_t,*omciMeInst_ptr;


typedef struct omciInst_s{
	pthread_mutex_t omciInstLock;
	omciMeInst_t *omciMeInstList;
}omciInst_t, *omciInst_p;

typedef struct omciManageEntity_s
{
	uint16_t omciMeClassId;
	char omciMeName[128];
	uint8_t access;// OMCI_ME_ACCESS_OLT.....
	uint8_t support;//
	/*function define*/
	int (*omciMeInitFunc)(struct omciManageEntity_s *omciManageEntity_p);
	int (*omciActionFunc[MT_OMCI_MSG_TYPE_MAX])(/*uint16_t omciMeIndex,*/ uint16_t meClassId , omciMeInst_t *meInstant_ptr, omciGenericPayload_t *omciPayLoad, uint8_t msgSrc);

	/*ATTRIBUTE define*/
	omciAttriDescript_t *omciAttriDescriptList;	

	/*instant define*/
	omciInst_t omciInst;	
	/*ALARM */
	uint8_t *alarmIdMapTable;
	uint32_t	specficFlag; 						/*consider some specfic case, when the bit is setted, the me is belong to this case*/
}omciManageEntity_t,*omciManageEntity_ptr;

typedef struct omciInterCreateME_s
{
	uint16_t index;
	uint16_t mainClassId;
	uint16_t secondClassId;/*the secondClassId ME depend on mainClassId ME instance*/
}omciInterCreateME_t,*omciInterCreateME_Ptr;

typedef struct GNU_PACKED omciInitMEInstVal_s
{
    union {
        omci_onu_g_t onu_g;
        omci_onu2_g_t onu2_g;
        omci_onu_data_t onuData;
        omci_cardholder_t cardholder;
        omci_circuit_pack_t circuitPack;
        omci_onu_power_shedding_t onuPowershedding;
        omci_ani_g_t ani_g;
        omci_t_cont_t tcont;
        omci_olt_g_t olt_g;
        omci_attribute_t attribute;
        omci_managed_entity_t ME;
        omci_omci_t omci;
        omci_file_transfer_ctrl_t fileTransCtrl;
        omci_onu_remote_debug_t onuRemotedbg;
        omci_software_image_t softImage;
        omci_voip_cfg_data_t voipCfgData;
        omci_enhanced_security_ctrl_t enhancedSecurityCtrl;
        omci_uni_g_t uni_g;
        omci_pptp_eth_uni_t ethUni;
        omci_veip_t veip;
        omci_tr69_manage_srv_t tr69MgSrv;
        omci_large_string_t largeString;
        omci_auth_security_method_t authSecurityMethod;
        omci_network_address_t netAddr;
        omci_pptp_pots_uni_t potsUni;
        omci_voip_line_status_t voipLineStatus;
        omci_ip_host_cfg_t iphostCfgData;
        omci_priority_queue_t priorityQueue;
        omci_traffic_scheduler_t trafficScheduler;
		omci_time_status_message_t timeStatusMessage;
		omci_pptp_video_uni_t pptpVideoUni;
		omci_pptp_video_ani_t pptpVideoAni;
    }GNU_PACKED;
}omciInitMEInstVal_t, *omciInitMEInstVal_ptr;

typedef struct omciOnuCreateME_s
{
	uint16_t classId;
	uint16_t startInstId;
	uint8_t *data;
	int (*initMeInstStruct)(uint16_t classId, uint16_t instId, uint8_t *data);
}omciOnuCreateME_t,*omciOnuCreateME_Ptr;


typedef struct omciCapablity_s
{
	omciSystemCapablity_t systemCap;
	omciOnuCapablity_t	onuCap;
	omciAniCapablity_t		aniCap;
}omciCapablity_t,*omciCapablity_ptr;





/**********************************************
*************Function declare**************
*******************/
int omciMeTableInit(void);
int  omciInitInst(void);
int omciInitCapability(void);
void omciDumpAdptStruct(omciManageEntity_ptr me, uint8_t *data, uint16_t lenth);
int omciDumpInstanceData(omciManageEntity_ptr me);
int omciDumpPkt(omciGenericPayload_t * txPkt);
int omciTxRxSavePkt(omciGenericPayload_t * pkt, char flag);
void omciDumpMeTable();
int omciDumpInstanceByMEID(uint16_t classId, uint16_t instId);
int omciDumpInstListByMEID(uint16_t classId);
int getPortIdxByInstId(uint16_t instId);
uint16_t generanteAttriInstId(uint16_t classId, uint16_t attributeId);

int parseFileInfo();
void setMeNotUpload();
uint8_t *reallocUploadBuffer(uint8_t *content, int len, int *mibcmd_num);
int privateMEAction(uint16_t classId, uint16_t instId, int msgType, omciPayload_t *omciPayLoad);
int reinitInstByFileInfo();
int isIndexFileNotExist(char *path);


extern omciManageEntity_t  *omciMeTable;
extern omciOnuCapablity_ptr	pOnuCap;
extern omciManageEntity_t *omciVendorMeTable;
extern omciOnuCreateME_t *onuInitInst_VendorMeTable;
extern int vendorInitMeTableSize;

#endif // _OMCI_ME_H_

#ifndef _9_2_ME_H__
#define _9_2_ME_H__

int omciMeInitForAniG(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForTcont(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForGemPortCtp(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForGemPortPM(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForPriorityQueue(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForTrafficScheduler(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForTrafficDescriptor(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForGemportNetworkCtpPM(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForEnergyConsumPM(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForEnhancedFecPM(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForXgponTCPM(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForEnhancedTCPM(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForXgponDsMgntPM(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForXgponUsMgntPM(omciManageEntity_t *omciManageEntity_p);


extern uint8_t meMapTableAniG[];
extern omciAttriDescript_t omciAttriDescriptListAniG[];
extern omciAttriDescript_t omciAttriDescriptListTcont[];
extern omciAttriDescript_t omciAttriDescriptListGemPortCtp[];
extern omciAttriDescript_t omciAttriDescriptListGemPortPm[];
extern omciAttriDescript_t omciAttriDescriptListPriorityQueue[];
extern omciAttriDescript_t omciAttriDescriptListTrafficScheduler[];
extern omciAttriDescript_t omciAttriDescriptListTrafficDescriptor[];
extern omciAttriDescript_t omciAttriDescriptListGemportNetworkCtpPm[];
extern omciAttriDescript_t omciAttriDescriptListEnergyConsumptionPm[];
extern omciAttriDescript_t omciAttriDescriptListEnhancedFecPM[];
extern omciAttriDescript_t omciAttriDescriptListXgponTCPM[];
extern omciAttriDescript_t omciAttriDescriptListEnhancedTCPM[];
extern omciAttriDescript_t omciAttriDescriptListXgponDsMgntPM[];
extern omciAttriDescript_t omciAttriDescriptListXgponUsMgntPM[];

#endif //_9_2_ME_H__

#ifndef _9_13_11_ME_H_
#define _9_13_11_ME_H_
int32_t omciMeInitForEnhancedSecurityCtl(omciManageEntity_t *omciManageEntity_p);

extern omciAttriDescript_t omciAttriDescriptListEnhancedSecurityCtl[];

int handleEnhancedSecurityCtrl(uint16_t classId, uint8_t attrIdx, uint8_t *value);
#endif //_9_13_11_ME_H_

#ifndef _9_1_ME_H_
#define _9_1_ME_H_

int omciMeInitForUnkownMe(omciManageEntity_t *omciManageEntity_p);
extern omciAttriDescript_t omciAttriUnkownMe[];

int omciMeInitForOnuRemoteDebug(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForSoftwareImage(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForOnuG(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForOnu2G(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForOnuData(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForCardholder(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForCircuitPack(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForOnuPowerShedding(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForPortMapping(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForExtensionPackage(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForProtectionData(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForProtectionProfile(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForOnuE(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForOnuDynamicPower(omciManageEntity_t *omciManageEntity_p);

extern uint8_t meMapTableOnuG[];


extern omciAttriDescript_t omciAttriDescriptListOunRemoteDebug[];
extern omciAttriDescript_t omciAttriDescriptListSoftwareImage[];
extern omciAttriDescript_t omciAttriDescriptListOnuG[];
extern omciAttriDescript_t omciAttriDescriptListOnu2G[];
extern omciAttriDescript_t omciAttriDescriptListOnuData[];
extern omciAttriDescript_t omciAttriDescriptListCardholder[];
extern omciAttriDescript_t omciAttriDescriptListCircuitPack[];
extern omciAttriDescript_t omciAttriDescriptListOnuPowerShedding[];
extern omciAttriDescript_t omciAttriDescriptListPortMapping[];
extern omciAttriDescript_t omciAttriDescriptListExtensionPackage[];
extern omciAttriDescript_t omciAttriDescriptListProtectionData[];
extern omciAttriDescript_t omciAttriDescriptListProtectionProfile[];
extern omciAttriDescript_t omciAttriDescriptListOnuE[];
extern omciAttriDescript_t omciAttriDescriptListOnuDynamicPower[];


#endif //_9_1_ME_H_

#ifndef _9_5_ME_H_
#define _9_5_ME_H_

int omciMeInitForPPTPEthernetUNI(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForEthernetPMHistoryData(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForEthernetPMHistoryData2(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForEthernetPMHistoryData3(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForEthernetPMHistoryData4(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForVirtualEthernetInterfacePoint(omciManageEntity_t *omciManageEntity_p);


extern uint8_t alarmIdTableVirtualEthernetInterfacePoint[];
extern uint8_t alarmIdTablePPTPEthernetUNI[];
extern uint8_t alarmIdLoopDetection[];

extern omciAttriDescript_t omciAttriDescriptListPPTPEthernetUNI[];
extern omciAttriDescript_t omciAttriDescriptListEthernetPMHistoryData[];
extern omciAttriDescript_t omciAttriDescriptListEthernetPMHistoryData2[];
extern omciAttriDescript_t omciAttriDescriptListEthernetPMHistoryData3[];
extern omciAttriDescript_t omciAttriDescriptListEthernetPMHistoryData4[];
extern omciAttriDescript_t omciAttriDescriptListVirtualEthernetInterfacePoint[];

#endif //_9_5_ME_H_

#ifndef _9_12_ME_H_
#define _9_12_ME_H_

int omciMeInitForUniG(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForOltG(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForNetworkAddress(omciManageEntity_t *omciManageEntity_p);	
int omciMeInitForAuthenticationMethod(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForLargeString(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForThresholdData1(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForThresholdData2(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForThresholdData64bit(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForTimeStatusMessage(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForOmci(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForManagedEntity(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForAttribute(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForOctetString(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForGeneralBuffer(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForFileTransController(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForGenericStatus(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForTr069ManageServer(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForSnmpConfigData(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForGALEthernetProfile(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForGALEthernetPM(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForFecPM(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForGemIWTP(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForMulticastGemIWTP(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForPptpVideoUni(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForPptpVideoAni(omciManageEntity_t *omciManageEntity_p);


extern omciAttriDescript_t omciAttriDescriptListUniG[];
extern omciAttriDescript_t omciAttriDescriptListOltG[];
extern omciAttriDescript_t omciAttriDescriptListNetworkAddress[];
extern omciAttriDescript_t omciAttriDescriptListAuthenticationMethod[];
extern omciAttriDescript_t omciAttriDescriptListLargeString[];
extern omciAttriDescript_t omciAttriDescriptListThresholdData1[];
extern omciAttriDescript_t omciAttriDescriptListThresholdData2[];
extern omciAttriDescript_t omciAttriDescriptListThresholdData64bit[];
extern omciAttriDescript_t omciAttriDescriptListTimeStatusMessage[];
extern omciAttriDescript_t omciAttriDescriptListOmci[];
extern omciAttriDescript_t omciAttriDescriptListManagedEntity[];
extern omciAttriDescript_t omciAttriDescriptListAttribute[];
extern omciAttriDescript_t omciAttriDescriptListOctetString[];
extern omciAttriDescript_t omciAttriDescriptListGeneralBuffer[];
extern omciAttriDescript_t omciAttriDescriptListFileTransController[];
extern omciAttriDescript_t omciAttriDescriptListGenericStatus[];
extern omciAttriDescript_t omciAttriDescriptListSnmpConfigData[];
extern omciAttriDescript_t omciAttriDescriptListTr069ManageServer[];
extern omciAttriDescript_t omciAttriDescriptListGALEthernetProfile[];
extern omciAttriDescript_t omciAttriDescriptListGALEthernetPM[];
extern omciAttriDescript_t omciAttriDescriptListFecPM[];
extern omciAttriDescript_t omciAttriDescriptListGemIWTP[];
extern omciAttriDescript_t omciAttriDescriptListMulticastGemIWTP[];
extern omciAttriDescript_t omciAttriDescriptListPptpVideoUni[];
extern omciAttriDescript_t omciAttriDescriptListPptpVideoAni[];

#endif //_9_12_ME_H_

#ifndef _9_3_ME_H_
#define _9_3_ME_H_

int omciMeInitForDot1RateLimiter(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForDot1agMaintenanceDomain(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForDot1agMaintenanceAssociation(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForEthernetFrameExtendedPM(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForEthernetFrameExtendedPM64bit(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForMACBridgePortICMPv6Process(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForMACBridgeServiceProfile(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForMACBridgeConData(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForMACBridgePMHD(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForMACBridgePortConData(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForMACBridgePortDesignData(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForMACBridgePortFilterData(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForMACBridgePortFilterPreData(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForMACBridgePortData(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForMACBridgePortPMHD(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForEthFrameUpPMHD(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForEthFrameDownPMHD(omciManageEntity_t *omciManageEntity_p);
int omciMeInitFor_MulticastProfile(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForMulticasSubscribertCfgInfo(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForMulticastSubscriberMonitor(omciManageEntity_t *omciManageEntity_p);
int omciMeInitFor8021pMapperProfile(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForVlanTagFilterData(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForVlanTagOperation(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForVlanTagExtendOperation(omciManageEntity_t *omciManageEntity_p);



extern omciAttriDescript_t omciAttriDescriptListDot1RateLimiter[];
extern omciAttriDescript_t omciAttriDescriptListDot1agMaintenanceDomain[];
extern omciAttriDescript_t omciAttriDescriptListDot1agMaintenanceAssociation[];
extern omciAttriDescript_t omciAttriDescriptListMBEthnetFrameExtendedPM[];
extern omciAttriDescript_t omciAttriDescriptListEthernetFrameExtendedPM64bit[];
extern omciAttriDescript_t omciAttriDescriptListMBPortICMPv6Process[];
extern omciAttriDescript_t omciAttriDescriptListMBServiceProfile[];
extern omciAttriDescript_t omciAttriDescriptListMBConnData[];
extern omciAttriDescript_t omciAttriDescriptListMBPMHD[];
extern omciAttriDescript_t omciAttriDescriptListMBPortConData[];
extern omciAttriDescript_t omciAttriDescriptListMBPortDesignData[];
extern omciAttriDescript_t omciAttriDescriptListMBPortFilterData[];
extern omciAttriDescript_t omciAttriDescriptListMBPortFilterPreData[];
extern omciAttriDescript_t omciAttriDescriptListMBPortData[];
extern omciAttriDescript_t omciAttriDescriptListMBPortPMHD[];
extern omciAttriDescript_t omciAttriDescriptList_EthFrameUpPMHD[];
extern omciAttriDescript_t omciAttriDescriptListEthFrameDownPMHD[];
extern omciAttriDescript_t omciAttriDescriptListMulticastProfile[];
extern omciAttriDescript_t omciAttriDescriptListMulticasSubscribertCfgInfo[];
extern omciAttriDescript_t omciAttriDescriptListMulticastSubscriberMonitor[];
extern omciAttriDescript_t omciAttriDescriptList8021pMapperProfile[];
extern omciAttriDescript_t omciAttriDescriptListVlanTagFilterData[];
extern omciAttriDescript_t omciAttriDescriptListVlanTagOperation[];
extern omciAttriDescript_t omciAttriDescriptListVlanTagExtendOperation[];


#endif //_9_3_ME_H_

#ifndef _9_4_ME_H_
#define _9_4_ME_H_

int omciMeInitForIPHostConfigData(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForIPHostPM(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForTcpUdpConfigData(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForTcpUdpPM(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForPPPoECfg(omciManageEntity_t *omciManageEntity_p);


extern omciAttriDescript_t omciAttriDescriptListIPHostConfigData[];
extern omciAttriDescript_t omciAttriDescriptListIPHostPM[];
extern omciAttriDescript_t omciAttriDescriptListTcpUdpConfigData[];
extern omciAttriDescript_t omciAttriDescriptListTcpUdpPM[];
extern omciAttriDescript_t omciAttriDescriptListPPPoECfg[];


#endif //_9_4_ME_H_



#ifndef _9_9_ME_H_
#define _9_9_ME_H_

int omciMeInitForSipUserData(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForSIPAgentConfigData(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForVoipVoiceCTP(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForVoipMediaPro(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForVoipAppSvcProfile(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForRtpPMHistoryData(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForSipAgentPMHistoryData(omciManageEntity_t * omciManageEntity_p);
int omciMeInitForSipCallInitPMHistoryData(omciManageEntity_t * omciManageEntity_p);
int omciMeInitForMgcCfgData(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForVoipCfgData(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForNetDialPlanTbl(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForPptpPotsUNI(omciManageEntity_t * omciManageEntity_p);
int omciMeInitForVoiceServiceProfile(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForRtpProfileData(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForVoIPLineStatus(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForCallCtrlPMHistory(omciManageEntity_t * omciManageEntity_p);


extern uint8_t alarmIdTableSipUserData[];
extern uint8_t alarmIdTableMgcCfgData[];
extern uint8_t alarmIdTableVoipCfgData[];
extern uint8_t alarmIdTableSIPAgentConfigData[];

extern omciAttriDescript_t omciAttriDescriptListSipUserData[];
extern omciAttriDescript_t omciAttriDescriptListSIPAgentConfigData[];
extern omciAttriDescript_t omciAttriDescriptListVoipVoiceCTP[];
extern omciAttriDescript_t omciAttriDescriptListVoipMediaPro[];
extern omciAttriDescript_t omciAttriDescriptListVoIPAppSvcPro[];
extern omciAttriDescript_t omciAttriDescriptListRtpPMHistoryData[];
extern omciAttriDescript_t omciAttriDescriptListSipAgentPMHistoryData[];
extern omciAttriDescript_t omciAttriDescriptListSipCallInitPMHistoryData[];
extern omciAttriDescript_t omciAttriDescriptListMgcCfgData[];
extern omciAttriDescript_t omciAttriDescriptListVoipCfgData[];
extern omciAttriDescript_t omciAttriDescriptListNetDialPlanTbl[];
extern omciAttriDescript_t omciAttriDescriptListPptpPotsUNI[];
extern omciAttriDescript_t omciAttriDescriptListVoiceServiceProfile[];
extern omciAttriDescript_t omciAttriDescriptListRtpProfileData[];
extern omciAttriDescript_t omciAttriDescriptListVoIPLineStatus[];
extern omciAttriDescript_t omciAttriDescriptListCallCtrlPMHistory[];



#endif //_9_9_ME_H_

#ifndef _VENDOR_ME_H_
#define _VENDOR_ME_H_
int omciMeInitForOnuLoopDetection(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForOnuCapability(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForLoidAuthen(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForExtendMulticastProfile(omciManageEntity_t *omciManageEntity_p);

extern omciAttriDescript_t omciAttriDescriptListOnuCapability[];
extern omciAttriDescript_t omciAttriDescriptListLoidAuthentication[];
extern omciAttriDescript_t omciAttriDescriptListExtMulticastProfile[];
extern omciAttriDescript_t omciAttriDescriptListOnuLoopDetection[];


/*alcatel me*/
int omciMEInitForVoIPCallStatistics(omciManageEntity_t *omciManageEntity_p);
int omciMEInitForClockDataSet(omciManageEntity_t *omciManageEntity_p);
int omciMEInitForPTPMasterConfigDataProfile(omciManageEntity_t *omciManageEntity_p);
int omciMEInitForPTPPort(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForUNISupplemental1V2(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForTotalGemPortPM(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForEthernetTrafficPM(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForVlanTagDownstreamSupplemental1(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForVlanTagUpstreamPolicer(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForGEMPortProtocolMonitoringHistoryDataPart2(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForONTOpticalSupervisionStatus(omciManageEntity_t *omciManageEntity_p);
int omciMeInitForONTGenericV2(omciManageEntity_t *omciManageEntity_p);

extern omciAttriDescript_t omciAttriDescriptListVoIPCallStatistics[];
extern omciAttriDescript_t omciAttriDescriptListClockDataSet[];
extern omciAttriDescript_t omciAttriDescriptListPTPMasterConfigDataProfile[];
extern omciAttriDescript_t omciAttriDescriptListPTPPort[];
extern omciAttriDescript_t omciAttriDescriptListUNISupplemental1V2[];
extern omciAttriDescript_t omciAttriDescriptListTotalGemPortPm[];
extern omciAttriDescript_t omciAttriDescriptListEthernetTrafficPm[];
extern omciAttriDescript_t omciAttriDescriptListVlanTagDownstreamSupplemental1[];
extern omciAttriDescript_t omciAttriDescriptListVlanTagUpstreamPolicer[];
extern omciAttriDescript_t omciAttriDescriptListGEMPortProtocolMonitoringHistoryDataPart2[];
extern omciAttriDescript_t omciAttriDescriptListONTOpticalSupervisionStatus[];
extern omciAttriDescript_t omciAttriDescriptListONTGenericV2[];
#endif //_VENDOR_ME_H_
